package com.tsunami.common;

/**
 *  权限相关常量定义
 * @date 2021-11-10 10:36
 * @author  by lx
 */
public class AuthConstant {
    private AuthConstant(){}
    /**
     * JWT存储权限前缀
     */
    public static final String AUTHORITY_PREFIX = "ROLE_";

    /**
     * JWT存储权限属性
     */
    public static final String AUTHORITY_CLAIM_NAME = "authorities";

    /**
     * 后台管理client_id
     */
    public static final String ADMIN_CLIENT_ID = "admin-app";

    /**
     * 后台管理应用client_id
     */
    public static final String PORTAL_CLIENT_ID = "app";

    public static final String ADMIN_URL_PATTERN = "admin";

    /**
     * Redis缓存权限规则key
     */
    public static final String RESOURCE_ROLES_MAP_KEY = "auth:resourceRolesMap";

    /**
     * 认证信息Http请求头
     */
    public static final String JWT_TOKEN_HEADER = "Authorization";
    /**
     * JWT令牌前缀
     */
    public static final String JWT_TOKEN_PREFIX = "Bearer ";

    /**
     * 用户信息Http请求头
     */
    public static final String USER_TOKEN_HEADER = "user";
    /**
     * cookie请求头
     */
    public static final String COOKIE_HEADER = "Cookie";
    /**
     * 租户管理员编码
     */
    public static final String ROLE_ADMIN = "admin";
    /**
     * 租户子管理员编码
     */
    public static final String ROLE_SUB_ADMIN ="subAdmin";
    /**
     * 系统超级管理员编码
     */
    public static final String ROLE_SUPER_ADMIN ="superAdmin";
}
